package com.ltkj.common.core.utils;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;

/**
 *
 * @Author  luren
 * @Description 预订下单生成的各种
 **/
public class HotelCodeUtils {

    /**
     * 生成订单号1
     *
     * @return
     */
    public static String buildTicOrderNo() {
        return "T" + getRanom();
    }

    /**
     * 生成优惠券编号
     *
     * @return
     */
    public static String buildTicCouponNo() {
        return "C" + getRanom();
    }
    /**
     *  生成订单号2
     * @return
     */
    public static String buildOtherOrderNo(){
        return "O" + getRanom();
    }

    public static String getRanom() {
        Snowflake snowflake = IdUtil.getSnowflake(1, 1);
        String uuid = String.valueOf(snowflake.nextId());
        return uuid;
    }
}
